<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
echo "<h2>Конфигурация</h2>";
$this->table->set_heading('id', 'Название', 'Name', 'Тип', 'Значение', 'Действия');
$tmpl = array('table_open' => '<table border="0" cellpadding="0" cellspacing="0" class="admin_table">');
$this->table->set_template($tmpl);

$class = 'config';
if ($this->users_rights_model->check_rights($class, 'block', true)) $canblock = 1;
if ($this->users_rights_model->check_rights($class, 'unblock', true)) $canblock = 1;
if ($this->users_rights_model->check_rights($class, 'edit', true)) $canedit = 1;
if ($this->users_rights_model->check_rights($class, 'delete', true)) $candelete = 1;
if ($this->users_rights_model->check_rights($class, 'add', true)) $canadd = 1;

$d = 0;
foreach ($pages as $page) {
	$d++;
	$this->table->add_row(
			$page['config_id'],
			$page['config_title'],
			$page['config_name'],
			($page['config_type'] == 1?"Input":"Textarea"),
			$page['config_value'],
			showmeactions(
					$class,
					$page['config_id'],
					$page['config_status'],
					$canedit, 0, 0,
					$from
				)
		);
}
echo $this->table->generate();
echo "<div class='cc'></div>";
if ($canadd == 1)
echo $form;
?>
